#include "iteratr.h"


iteratr::iteratr(graph &gr,int n,int c)
{
	if(c!=1 && c!=-1)
	{
		//cerr<<"your value of c is not possible.The possible choices are 1 or -1"<<endl;
		//system("PAUSE");
		exit(1);
	}
	control=c;
	g=&gr;
	g->change_diagonal(control);
	node=n;
	start=0;
	while (g->get_edge(node,start)!=control && start<g->n_nodes())
		start++;
	next=start;
}
int iteratr::next_node()
{
	if(!check_for_next()) 
		return -1;
	else
	{
		int n=next;
		do
		{
		    next++;
		}while(g->get_edge(node,next)!=control && check_for_next());
		return n;
	}
}













